package com.varian.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.varian.tool.Func;
import com.varian.tool.enums.BaseEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author ben
 * @since 2024/7/13
 */
@Getter
@RequiredArgsConstructor
public enum MenuTypeEnum implements BaseEnum<MenuTypeEnum> {

    // 目录
    DIRECTORY(0, DictionaryGroup.class),
    // 菜单
    MENU(1, MenuGroup.class),
    // 按钮
    BUTTON(2, ButtonGroup.class),
    // 外链
    LINK(3, LinkGroup.class),
    // 接口
    ENDPOINT(4, EndpointGroup.class),
    ;

    @JsonValue
    @EnumValue
    final Integer value;
    final Class<?> group;

    @Override
    public MenuTypeEnum convert(Integer value) {
        return Func.findBaseEnumByValue(values(), value);
    }

    public interface DictionaryGroup {
    }

    public interface MenuGroup {
    }

    public interface ButtonGroup {
    }

    public interface LinkGroup {
    }

    public interface EndpointGroup {
    }
}
